
import $app from '@$@/js/$app';
import $router from '@/router'
let ListWarnInfo = {
  //ListWarnInfo_type:1待缴申请费，2待补正，3审查意见待答复，4待办理登记
  list(that) {
    let {
      ListWarnInfo_type
    } = that;

    let out = [
      {
        title: " ",
        type: "index",
        width: 30,
        align: "center ",
        className: "goOnTxt c999"
      },
      {
        type: "selection",
        className: "goOnTxt",
        align: "center",
        width: 40
      },

      
      {
        title: "专利名称",
        key: "name",
        className: "goOnTxt",
        width: 300,
        resizable: true,
      },
      {
        title: "专利号",
        className: "goOnTxt",
        key: "patent_number",
        width: 200,
        resizable: true,
      },
      {
        title: "申请人",
        className: "goOnTxt",
        width: 250,
        resizable: true,
        render: (h, params) => {
          let {
            row:{
              applicant_name_list,
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: " cBlue pointer",
                on:{
                  click:()=>{
                    $app.closeHadPage("patentList", () => {
                      // 页面跳转
                      $router.push({
                        name: "patentList",
                        query: {
                          query_key: applicant_name_list,
                          type:3
                        }
                      });
                    });
                  }
                }
              },
              applicant_name_list
            )
          ];
  
  
  
          return out;
        }
      }
    ];

    if (ListWarnInfo_type == 1) {
      out.push({
        title: "有效期",
        className: "goOnTxt",
        width: 120,
        resizable: true,
        render: (h, params) => {
          let {
            row: {
              demand_limit_date// 缴费 有效期
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: "  cRed  ",
              },
              $app.toDateDay(demand_limit_date)
            )
          ];
          return out;
        }
      },
        {
          title: "附件 （下载）",
          className: "goOnTxt",
          resizable: true,
          render: (h, params) => {
            let {
              row,
              row: {
                demand_note_path// 缴费通知书
              }
            } = params;
            let out = [];
            if ($app.judgeData(demand_note_path)) {
              out.push(
                h(
                  "span",
                  {
                    class: "lineH1d5 inlineBlock marginR20 cBlue"
                  },
                  [
                    h("i", { class: "iconfont marginR5 " + $app.fileIcon(demand_note_path) }),
                    h("span", {
                      class: "lineH1d5 textLine ",
                      on: {
                        click: () => {
                          this.warnNoteDown(demand_note_path);
                        }
                      },
                    }, '缴费通知书')
                  ]

                )
              )
            }

            return out;
          }
        });
    } else if (ListWarnInfo_type == 2) {
      out.push({
        title: "有效期",
        className: "goOnTxt",
        width: 120,
        resizable: true,
        render: (h, params) => {
          let {
            row: {
              bz_note_limit_date// 补正 有效期
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: "  cRed  ",
              },
              $app.toDateDay(bz_note_limit_date)
            )
          ];
          return out;
        }
      },
        {
          title: "附件 （下载）",
          className: "goOnTxt",
          resizable: true,
          render: (h, params) => {
            let {
              row,
              row: {
                bz_note_path// 补正通知书
              }
            } = params;
            let out = [];
            if ($app.judgeData(bz_note_path)) {
              out.push(
                h(
                  "span",
                  {
                    class: "lineH1d5 inlineBlock marginR20 cBlue"
                  },
                  [
                    h("i", { class: "iconfont marginR5 " + $app.fileIcon(bz_note_path) }),
                    h("span", {
                      class: "lineH1d5 textLine ",
                      on: {
                        click: () => {
                          this.warnNoteDown(bz_note_path);
                        }
                      },
                    }, '补正通知书')
                  ]

                )
              )
            }

            return out;
          }
        });
    } else if (ListWarnInfo_type == 3) {
      out.push({
        title: "有效期",
        className: "goOnTxt",
        width: 120,
        resizable: true,
        render: (h, params) => {
          let {
            row: {
              oa_note_limit_date// 审查意见通知书 有效期
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: "  cRed  ",
              },
              $app.toDateDay(oa_note_limit_date)
            )
          ];
          return out;
        }
      },
        {
          title: "附件 （下载）",
          className: "goOnTxt",
          resizable: true,
          render: (h, params) => {
            let {
              row,
              row: {
                oa_note_path// 审查意见通知书
              }
            } = params;
            let out = [];
            if ($app.judgeData(oa_note_path)) {
              out.push(
                h(
                  "span",
                  {
                    class: "lineH1d5 inlineBlock marginR20 cBlue"
                  },
                  [
                    h("i", { class: "iconfont marginR5 " + $app.fileIcon(oa_note_path) }),
                    h("span", {
                      class: "lineH1d5 textLine ",
                      on: {
                        click: () => {
                          this.warnNoteDown(oa_note_path);
                        }
                      },
                    }, '审查意见通知书')
                  ]

                )
              )
            }

            return out;
          }
        });
    } else if (ListWarnInfo_type == 4) {
      out.push({
        title: "有效期",
        className: "goOnTxt",
        width: 120,
        resizable: true,
        render: (h, params) => {
          let {
            row: {
              dealt_register_limit_date// 授权通知书 有效期
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: "  cRed  ",
              },
              $app.toDateDay(dealt_register_limit_date)
            )
          ];
          return out;
        }
      },
        {
          title: "附件 （下载）",
          className: "goOnTxt",
          resizable: true,
          render: (h, params) => {
            let {
              row,
              row: {
                auth_note_path,//授权通知书
                dealt_register_note_path//缴费通知书
              }
            } = params;
            let out = [];
            if ($app.judgeData(auth_note_path)) {
              out.push(
                h(
                  "span",
                  {
                    class: "lineH1d5 inlineBlock marginR20 cBlue"
                  },
                  [
                    h("i", { class: "iconfont marginR5 " + $app.fileIcon(auth_note_path) }),
                    h("span", {
                      class: "lineH1d5 textLine ",
                      on: {
                        click: () => {
                          this.warnNoteDown(auth_note_path);
                        }
                      },
                    }, '授权通知书')
                  ]

                )
              )
            }
            if ($app.judgeData(dealt_register_note_path)) {
              out.push(
                h(
                  "span",
                  {
                    class: "lineH1d5 inlineBlock marginR20 cBlue"
                  },
                  [
                    h("i", { class: "iconfont marginR5 " + $app.fileIcon(dealt_register_note_path) }),
                    h("span", {
                      class: "lineH1d5 textLine ",
                      on: {
                        click: () => {
                          this.warnNoteDown(dealt_register_note_path);
                        }
                      },
                    }, '缴费通知书')
                  ]

                )
              )
            }

            return out;
          }
        });
    }



    out.push({
      title: "操作",
      className: "goOnTxt",
      render: (h, params) => {
        let {
          row,
          row: {
            order_id,
            goods_type
          }
        } = params;
        let out = [];

        console.log('44 = ',goods_type)


        out.push(
          h(
            "span",
            {
              class: "  cBlue textLink ",
              on: {
                click: () => {
                  let name = '';
                  if($app.is100_102(goods_type)){
                    name = 'patentDetails';//100~102 正常订单
                  }else{
                    name = 'patentThird';//	103 104 105 和 130 131 132
                  }

                  $router.push({
                    name,
                    query: {
                      order_id
                    }
                  });
                  
                }
              }
            },
            `查看详情`
          ),
          // h(
          //   "span",
          //   {
          //     class: "  cCCC marginR10",
          //   },
          //   `|`
          // ),
          // h(
          //   "span",
          //   {
          //     class: "  c999 textLink",
          //     on: {
          //       click: () => {
          //         that.huLA(row);
          //       }
          //     }
          //   },
          //   `忽略`
          // ),
        );



        return out;
      }
    });



    return out;
  },

  // 通知书下载改名字
  warnNoteDown(url){
    $app.openWindow(url);
  },
}

// 表格 列 配置
export default ListWarnInfo;